yesterday because to get the password from the JFrame control, notice a problem, that is, the ToString method is not necessarily what you want, as follows:JPasswordField is the password input box in JFrame, if the following method is not available
The JS function has an extraordinary feature, the ability to reproduce its source code as a string.(function (x) { return x+1}). toString ();//"function (x) { return x+1}"Reflection Gets the function source code is very powerful, using the
Previous wordsThis article describes the ToString () method, which returns a string that reflects the object."1" Undefined and null do not have the ToString () methodUndefined.tostring (); // Error null. toString (); // Error"2" Boolean data True
Typeof + instanceof + toString + constructor: How does one determine the javascript data type? typeofinstanceofI. typeof
Variables in JS are loose (weak type) and can be used to save any type of data.Typeof can be used to detect the Data Type of a
Deep understanding of ToString () and valueof () functions
1. Why do we have to understand both of these methods
It is well known that the toString () function and the valueof function, which are objects of the object class, are inherently owned,
1. Why do we need to know both of these methodsAs we all know, the toString () function and the valueof function, these two functions are inherently owned by objects of the object class, and they can also allow us to rewrite, so what is the use of
Remind everyone that Object. prototype. toString (). in the [objectclass] returned by call (param), the first letter of the class is in upper case, such as JSON, or even in upper case. Therefore, you can convert the class to lower case when making a
This article mainly introduces how to use Object in JavaScript. prototype. toString determines whether it is an array. This article describes the Object. prototype. toString related knowledge, and provides the implementation code to judge the array.
Digression: To determine whether an object is a problem that is not an array. For a Web page, or a global scope, the instanceof operator can be used to achieve satisfactory results:
if (value instanceof Array) {}
The problem, however, is that the
In JavaScript, the valueOf function method returns the original value of the specified object. Usage:Object. valueOf () object is a required parameter and is an inherent JScript object.The valueOf method definition of each inherent JavaScript Object
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.